package com.yic.module.device.controller.admin.fault.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.math.BigDecimal;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;

import static com.yic.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * 设备报修 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class FaultBaseVO {

    @Schema(description = "报修单号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "报修单号不能为空")
    private String code;

    @Schema(description = "紧急程度", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "紧急程度不能为空")
    private Integer emergent;

    @Schema(description = "故障描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
    @NotNull(message = "故障描述不能为空")
    private String description;

    @Schema(description = "报障时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime faultTime;

    @Schema(description = "报障图片", example = "https://www.iocoder.cn")
    private String imgUrl;

    @Schema(description = "报障视频", example = "https://www.iocoder.cn")
    private String videoUrl;

    @Schema(description = "报障人", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long userId;

    @Schema(description = "报障部门", requiredMode = Schema.RequiredMode.REQUIRED, example = "3073")
    private Long deptId;

    @Schema(description = "设备", requiredMode = Schema.RequiredMode.REQUIRED, example = "13145")
    @NotNull(message = "设备不能为空")
    private Long deviceId;

    @Schema(description = "工厂", example = "3728")
    private Long factoryId;

    @Schema(description = "工作中心", example = "11443")
    private Long centerId;

    @Schema(description = "确认时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime confirmTime;

    @Schema(description = "工单状态", example = "2")
    private Integer status;

    @Schema(description = "开始处理时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime startTime;

    @Schema(description = "结束处理时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime endTime;

    @Schema(description = "处理时长")
    private BigDecimal duration;

    @Schema(description = "处理人")
    private Long handleUser;

}
